"""
关闭窗口
刷新窗口
"""
import time
from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.maximize_window()
driver.get("https://baidu.com")
driver.find_element(By.CSS_SELECTOR, "a[href='http://news.baidu.com']").click()
driver.find_element(By.CSS_SELECTOR, "a[href='http://news.baidu.com']").click()
time.sleep(3)
driver.refresh()  # 刷新窗口
driver.close()  # 关闭当前窗口
time.sleep(3)
driver.quit()  # 关闭进程
